package com.lz.ionicbase.engine;


import android.content.Context;

import com.lz.ionicbase.engine.callback.AppCallback;
import com.lz.ionicbase.ui.activity.action.IAction;
import com.lzy.okgo.OkGo;

import java.util.Map;

/**
 * Created by wyfei on 2017/2/9.
 */

public abstract class BaseHelper {

    private IAction iAction;
    private Context context;

    public BaseHelper(IAction iAction, Context context) {
        this.iAction = iAction;
        this.context = context;
    }

    protected void onError() {

    }

    protected void onDestroy() {
        iAction = null;
    }

    protected void getData(String url, Map<String, String> param, AppCallback callback) {
        OkGo.post(url)
                .tag(this)
                .params(param)
                .execute(callback);
    }

}
